<%@ page contentType="text/html; charset=utf-8" %>
<script type='text/javascript' src='/SameBuilding/javascript/jquery-1.2.6.js'></script>
<script type='text/javascript' src='/SameBuilding/javascript/jquery.blockUI.js'></script>
<link rel="stylesheet" type="text/css" media="screen" href="../css/block.css" />

<script>
function validate(){
var allowedTypes=['jpg','gif','png'];
var flag=true;
$(":file").each(function(){
	var fileName=this.value;
	if(fileName){
	
		var idx=fileName.lastIndexOf('.');
		var sufix=fileName.substring(idx+1);
		for(var i=0;i<allowedTypes.length;i++){
			if(sufix==allowedTypes[i]){
				return;
			}
		}
		alert(fileName+" 格式不对.\n只支持jpg,gif,png.");
		flag=false;
	}
});
return flag;
}
function showResult(msg){
	alert(1);
	//parent.$J.unblockUI();
	//alert(msg);
}

$(function(){
$("#uploadForm").bind('submit',parent.blockUploading);	
$("#categorySelect").html(parent.getCategorySelection());
});
</script>
<form action="upload.do" method="post" target="hiddenTarget" encType="multipart/form-data" onsubmit="return validate();" id="uploadForm">
	选择相册：<select id="categorySelect" name="categoryCode">
			</select>
	<p>
		1: <input type="file" name="file1"><br>
		2: <input type="file" name="file2"><br>
		3: <input type="file" name="file3"><br>
		4: <input type="file" name="file4"><br>
		5: <input type="file" name="file5"><br>
		<input type="submit" value="开始上传" /> 
</form>
